from rest_framework import serializers

from .models import Area


class AreasInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = Area
        fields = ("id","name")

class AreasSubsInfoSerializer(serializers.ModelSerializer):
    subs = AreasInfoSerializer(read_only=True,many=True)
    class Meta:
        model = Area
        fields = ("id","name","subs")

